Skip to content

[RF] Modernize RooFit code with static_range_cast and dynamic_range_cast#22662

Merged
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:roofit_modernize
Jun 19, 2026
Merged

[RF] Modernize RooFit code with static_range_cast and dynamic_range_cast#22662
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:roofit_modernize

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

The static_range_cast and dynamic_range_cast are RooFit helper functions to iterate over polymorphic collections like RooArgSet and RooArgList. Using them instead of casting in a separate line makes the code more concise with fewer lines and throw-away temoprary variables.

The `static_range_cast` and `dynamic_range_cast` are RooFit helper
functions to iterate over polymorphic collections like `RooArgSet` and
`RooArgList`. Using them instead of casting in a separate line makes the
code more concise with fewer lines and throw-away temoprary variables.
@guitargeek guitargeek self-assigned this Jun 19, 2026
@guitargeek guitargeek requested a review from hageboeck as a code owner June 19, 2026 06:57
@guitargeek guitargeek requested a review from lmoneta June 19, 2026 06:57
@vepadulano

Copy link
Copy Markdown
Member

Just as a curiosity, how are these different from ROOT::Detail::TRangeStaticCast and ROOT::Detail::TRangeDynCast? And what should be used in general?

@guitargeek

Copy link
Copy Markdown
Contributor Author

It's the same. Originally, I only had static_range_cast and dynamic_range_cast in RooFit, before I "upstreamed" them to ROOT core as ROOT::Detail::TRangeStaticCast and ROOT::Detail::TRangeDynCast.

For now, I prefer to keep the RooFit code at static_range_cast and dynamic_range_cast because I like the names much more, as for the ROOT core versions I was asked to follow the ROOT naming conventions which made the names a bit awkward.

@github-actions

Copy link
Copy Markdown

Test Results

    21 files      21 suites   3d 7h 26m 27s ⏱️
 3 869 tests  3 869 ✅ 0 💤 0 ❌
72 652 runs  72 652 ✅ 0 💤 0 ❌

Results for commit 801f960.

@lmoneta lmoneta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@guitargeek guitargeek merged commit 4f2cf43 into root-project:master Jun 19, 2026
32 of 37 checks passed
@guitargeek guitargeek deleted the roofit_modernize branch June 19, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants